package com.ie.cloud.payment.service.impl.event;

import com.ie.cloud.payment.dto.event.CallbackMsgEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * Created with FR
 *
 * @Author: DQ
 * @Date: 2025/07/18/14:38
 * @Description: 回调报文发布服务
 */
@Service
@Slf4j
public class CallbackMessagePublishService {




    @Resource
    private ApplicationEventPublisher applicationEventPublisher;



    @Async
    public void publish(String msg) {
        log.info("发布回调报文：{},时间 {}", msg, LocalDateTime.now());
        applicationEventPublisher.publishEvent(new CallbackMsgEvent(msg));
    }


}
